﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:controls="clr-namespace:Framework.UI.Controls"
                    xmlns:params="http://schemas.codeplex.com/elysium/params">
    <ResourceDictionary.MergedDictionaries>
        <controls:SharedResourceDictionary Source="/Framework.UI;component/Themes/WPF/Base/Converter.xaml"/>
        <controls:SharedResourceDictionary Source="/Framework.UI;component/Themes/WPF/Base/Brush.xaml"/>
        <controls:SharedResourceDictionary Source="/Framework.UI;component/Themes/WPF/Base/FocusVisualStyle.xaml"/>
        <controls:SharedResourceDictionary Source="/Framework.UI;component/Themes/ElysiumExtra/Icon.xaml"/>
        <controls:SharedResourceDictionary Source="/Framework.UI;component/Themes/ElysiumExtra/GeometryIcon.xaml"/>
        <controls:SharedResourceDictionary Source="/Framework.UI;component/Themes/ElysiumExtra/NumericUpDown.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <!-- MenuItem -->
    <Style x:Key="{x:Static MenuItem.SeparatorStyleKey}" TargetType="{x:Type Separator}">
        <Setter Property="Background" Value="{StaticResource TransparentBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource AccentBrush}"/>
        <Setter Property="BorderThickness" Value="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.DefaultThickness), Mode=OneWay}"/>
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Padding" Value="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPaddingValue), Mode=OneWay}"/>
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Separator}">
                    <Border Background="{TemplateBinding Background}"
                            BorderThickness="0"
                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                        <Line Stroke="{TemplateBinding BorderBrush}"
                              StrokeThickness="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ThicknessToDoubleConverter}}"
                              X1="0" Y1="0"
                              X2="1" Y2="0"
                              Stretch="Fill"
                              Margin="{TemplateBinding Padding}"
                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <ControlTemplate x:Key="{x:Static MenuItem.TopLevelHeaderTemplateKey}" TargetType="{x:Type MenuItem}">
        <Border x:Name="LayoutRoot"
                Background="{TemplateBinding Background}"
                BorderBrush="{TemplateBinding BorderBrush}"
                BorderThickness="{TemplateBinding BorderThickness}"
                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
            <Grid x:Name="ContentHost"
                  TextBlock.Foreground="{TemplateBinding Foreground}"
                  TextBlock.FontFamily="{TemplateBinding FontFamily}"
                  TextBlock.FontSize="{TemplateBinding FontSize}"
                  TextBlock.FontStretch="{TemplateBinding FontStretch}"
                  TextBlock.FontStyle="{TemplateBinding FontStyle}"
                  TextBlock.FontWeight="{TemplateBinding FontWeight}"
                  TextOptions.TextFormattingMode="{TemplateBinding TextOptions.TextFormattingMode}"
                  TextOptions.TextRenderingMode="{TemplateBinding TextOptions.TextRenderingMode}"
                  RenderOptions.ClearTypeHint="{TemplateBinding RenderOptions.ClearTypeHint}">
                <ContentPresenter x:Name="HeaderHost"
                                  ContentSource="Header"
                                  RecognizesAccessKey="True"
                                  Margin="{TemplateBinding Padding}"
                                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                <Popup x:Name="PART_Popup"
                       Grid.IsSharedSizeScope="True"
                       AllowsTransparency="True"
                       Focusable="False"
                       IsOpen="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsSubmenuOpen, Mode=TwoWay}"
                       Placement="Custom"
                       PlacementTarget="{Binding ElementName=LayoutRoot}"
                       CustomPopupPlacementCallback="{x:Static params:DropDown.PopupPlacementCallback}">
                    <Border x:Name="PopupRoot"
                            Tag="{DynamicResource {x:Static SystemParameters.DropShadowKey}}"
                            SnapsToDevicePixels="True">
                        <Grid>
                            <Border Background="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=(params:MenuBase.SubmenuBackground)}"
                                    BorderBrush="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=(params:MenuBase.SubmenuBorderBrush)}"
                                    BorderThickness="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=(params:MenuBase.SubmenuBorderThickness)}"
                                    TextBlock.Foreground="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=Foreground}"
                                    TextBlock.FontFamily="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=FontFamily}"
                                    TextBlock.FontSize="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=FontSize}"
                                    TextBlock.FontStretch="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=FontStretch}"
                                    TextBlock.FontStyle="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=FontStyle}"
                                    TextBlock.FontWeight="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=FontWeight}"
                                    TextOptions.TextFormattingMode="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=(TextOptions.TextFormattingMode)}"
                                    TextOptions.TextRenderingMode="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=(TextOptions.TextRenderingMode)}"
                                    RenderOptions.ClearTypeHint="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=(RenderOptions.ClearTypeHint)}"
                                    HorizontalAlignment="Stretch"
                                    VerticalAlignment="Stretch">
                                <StackPanel IsItemsHost="True"
                                            KeyboardNavigation.DirectionalNavigation="Cycle"/>
                            </Border>
                            <Rectangle x:Name="PopupMask"
                                       Fill="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=(params:MenuBase.SubmenuBackground)}"
                                       Margin="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=(params:MenuBase.SubmenuBorderThickness), Converter={StaticResource ThicknessConverter}, ConverterParameter='Left'}"
                                       HorizontalAlignment="Left"
                                       VerticalAlignment="Top"
                                       Width="{Binding ElementName=ContentHost, Path=ActualWidth}"/>
                        </Grid>
                    </Border>
                </Popup>
            </Grid>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsSubmenuOpen" Value="True">
                <Setter TargetName="PART_Popup" Property="params:DropDown.IsOpen" Value="True"/>
            </Trigger>
            <Trigger SourceName="PART_Popup" Property="IsOpen" Value="True">
                <Setter TargetName="LayoutRoot" Property="Background" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=(params:MenuBase.SubmenuBackground)}"/>
                <Setter TargetName="LayoutRoot" Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=(params:MenuBase.SubmenuBorderBrush)}"/>
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition SourceName="PART_Popup" Property="IsOpen" Value="True"/>
                    <Condition SourceName="PART_Popup" Property="params:DropDown.IsDefaultHorizontalPosition" Value="True"/>
                    <Condition SourceName="PART_Popup" Property="params:DropDown.IsDefaultVerticalPosition" Value="True"/>
                </MultiTrigger.Conditions>
                <MultiTrigger.Setters>
                    <Setter TargetName="LayoutRoot" Property="BorderThickness" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=(params:MenuBase.SubmenuBorderThickness), Converter={StaticResource ThicknessConverter}, ConverterParameter='Left, Top, Right'}"/>
                    <Setter TargetName="PopupMask" Property="Height" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=(params:MenuBase.SubmenuBorderThickness), Converter={StaticResource ThicknessToDoubleConverter}, ConverterParameter='Top'}"/>
                </MultiTrigger.Setters>
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition SourceName="PART_Popup" Property="IsOpen" Value="True"/>
                    <Condition SourceName="PART_Popup" Property="params:DropDown.IsDefaultHorizontalPosition" Value="True"/>
                    <Condition SourceName="PART_Popup" Property="params:DropDown.IsDefaultVerticalPosition" Value="False"/>
                </MultiTrigger.Conditions>
                <MultiTrigger.Setters>
                    <Setter TargetName="LayoutRoot" Property="BorderThickness" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=(params:MenuBase.SubmenuBorderThickness), Converter={StaticResource ThicknessConverter}, ConverterParameter='Left, Right, Bottom'}"/>
                    <Setter TargetName="PopupMask" Property="Height" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=(params:MenuBase.SubmenuBorderThickness), Converter={StaticResource ThicknessToDoubleConverter}, ConverterParameter='Bottom'}"/>
                    <Setter TargetName="PopupMask" Property="VerticalAlignment" Value="Bottom"/>
                </MultiTrigger.Setters>
            </MultiTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding ElementName=PopupRoot, Path=Tag}" Value="True"/>
                    <Condition Binding="{Binding ElementName=PART_Popup, Path=(params:DropDown.IsDefaultVerticalPosition)}" Value="True"/>
                </MultiDataTrigger.Conditions>
                <MultiDataTrigger.Setters>
                    <Setter TargetName="PopupRoot" Property="Effect">
                        <Setter.Value>
                            <DropShadowEffect Color="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=(params:General.ShadowBrush).(SolidColorBrush.Color)}"
                                                          BlurRadius="4" ShadowDepth="2"
                                                          Direction="315"
                                                          Opacity="0.3"/>
                        </Setter.Value>
                    </Setter>
                    <Setter TargetName="PopupRoot" Property="Background" Value="{StaticResource TransparentBrush}"/>
                    <Setter TargetName="PopupRoot" Property="Padding" Value="0,0,6,6"/>
                </MultiDataTrigger.Setters>
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding ElementName=PopupRoot, Path=Tag}" Value="True"/>
                    <Condition Binding="{Binding ElementName=PART_Popup, Path=(params:DropDown.IsDefaultVerticalPosition)}" Value="False"/>
                </MultiDataTrigger.Conditions>
                <MultiDataTrigger.Setters>
                    <Setter TargetName="PopupRoot" Property="Effect">
                        <Setter.Value>
                            <DropShadowEffect Color="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=(params:General.ShadowBrush).(SolidColorBrush.Color)}"
                                                          BlurRadius="4" ShadowDepth="0"
                                                          Direction="45"
                                                          Opacity="0.3"/>
                        </Setter.Value>
                    </Setter>
                    <Setter TargetName="PopupRoot" Property="Background" Value="{StaticResource TransparentBrush}"/>
                    <Setter TargetName="PopupRoot" Property="Padding" Value="0,4,4,0"/>
                </MultiDataTrigger.Setters>
            </MultiDataTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <ControlTemplate x:Key="{x:Static MenuItem.TopLevelItemTemplateKey}" TargetType="{x:Type MenuItem}">
        <Border x:Name="LayoutRoot"
                Background="{TemplateBinding Background}"
                BorderBrush="{TemplateBinding BorderBrush}"
                BorderThickness="{TemplateBinding BorderThickness}"
                TextBlock.Foreground="{TemplateBinding Foreground}"
                TextBlock.FontFamily="{TemplateBinding FontFamily}"
                TextBlock.FontSize="{TemplateBinding FontSize}"
                TextBlock.FontStretch="{TemplateBinding FontStretch}"
                TextBlock.FontStyle="{TemplateBinding FontStyle}"
                TextBlock.FontWeight="{TemplateBinding FontWeight}"
                TextOptions.TextFormattingMode="{TemplateBinding TextOptions.TextFormattingMode}"
                TextOptions.TextRenderingMode="{TemplateBinding TextOptions.TextRenderingMode}"
                RenderOptions.ClearTypeHint="{TemplateBinding RenderOptions.ClearTypeHint}"
                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
            <ContentPresenter x:Name="HeaderHost"
                                ContentSource="Header"
                                RecognizesAccessKey="True"
                                Margin="{TemplateBinding Padding}"/>
        </Border>
    </ControlTemplate>
    <ControlTemplate x:Key="{x:Static MenuItem.SubmenuHeaderTemplateKey}" TargetType="{x:Type MenuItem}">
        <Border x:Name="LayoutRoot"
                Background="{TemplateBinding Background}"
                BorderBrush="{TemplateBinding BorderBrush}"
                BorderThickness="{TemplateBinding BorderThickness}"
                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
            <Grid TextBlock.Foreground="{TemplateBinding Foreground}"
                  TextBlock.FontFamily="{TemplateBinding FontFamily}"
                  TextBlock.FontSize="{TemplateBinding FontSize}"
                  TextBlock.FontStretch="{TemplateBinding FontStretch}"
                  TextBlock.FontStyle="{TemplateBinding FontStyle}"
                  TextBlock.FontWeight="{TemplateBinding FontWeight}"
                  TextOptions.TextFormattingMode="{TemplateBinding TextOptions.TextFormattingMode}"
                  TextOptions.TextRenderingMode="{TemplateBinding TextOptions.TextRenderingMode}"
                  RenderOptions.ClearTypeHint="{TemplateBinding RenderOptions.ClearTypeHint}"
                  Margin="{TemplateBinding Padding}"
                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"
                                      SharedSizeGroup="ContextMenuIconSizeGroup"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <ContentPresenter x:Name="IconHost"
                                  Grid.Column="0"
                                  ContentSource="Icon"
                                  HorizontalAlignment="Left"
                                  VerticalAlignment="Center"
                                  MinWidth="16" MinHeight="16"/>
                <ContentPresenter x:Name="HeaderHost"
                                  Grid.Column="1"
                                  ContentSource="Header"
                                  RecognizesAccessKey="True"
                                  Margin="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(params:General.BoldPaddingValue), Mode=OneWay, Converter={StaticResource DoubleToThicknessConverter}, ConverterParameter='Left, Right'}"
                                  HorizontalAlignment="Left"
                                  VerticalAlignment="Center"/>
                <Polygon x:Name="ArrowGlyph"
                         Grid.Column="2"
                         Fill="{StaticResource AccentBrush}"
                         StrokeThickness="0"
                         Stretch="Uniform"
                         Margin="{TemplateBinding params:MenuItem.ArrowMargin}"
                         HorizontalAlignment="Right" VerticalAlignment="Center"
                         Width="{TemplateBinding params:MenuItem.ArrowSize}"
                         Height="{TemplateBinding params:MenuItem.ArrowSize}">
                    <Polygon.Points>
                        <PointCollection>
                            <Point X="0" Y="0"/>
                            <Point X="2" Y="2"/>
                            <Point X="0" Y="4"/>
                        </PointCollection>
                    </Polygon.Points>
                </Polygon>
                <Popup x:Name="PART_Popup"
                       Grid.Column="0" Grid.IsSharedSizeScope="True"
                       AllowsTransparency="True"
                       Focusable="False"
                       Placement="Right"
                       PlacementTarget="{Binding ElementName=LayoutRoot}"
                       IsOpen="{TemplateBinding IsSubmenuOpen}"
                       PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}"
                       Tag="{DynamicResource {x:Static SystemParameters.MenuAnimationKey}}">
                    <Border x:Name="PopupRoot"
                            Tag="{DynamicResource {x:Static SystemParameters.DropShadowKey}}">
                        <Border Background="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=(params:MenuBase.SubmenuBackground)}"
                                BorderBrush="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=(params:MenuBase.SubmenuBorderBrush)}"
                                BorderThickness="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=(params:MenuBase.SubmenuBorderThickness)}"
                                TextBlock.Foreground="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=Foreground}"
                                TextBlock.FontFamily="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=FontFamily}"
                                TextBlock.FontSize="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=FontSize}"
                                TextBlock.FontStretch="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=FontStretch}"
                                TextBlock.FontStyle="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=FontStyle}"
                                TextBlock.FontWeight="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=FontWeight}"
                                TextOptions.TextFormattingMode="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=(TextOptions.TextFormattingMode)}"
                                TextOptions.TextRenderingMode="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=(TextOptions.TextRenderingMode)}"
                                RenderOptions.ClearTypeHint="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=(RenderOptions.ClearTypeHint)}"
                                SnapsToDevicePixels="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=SnapsToDevicePixels}">
                            <StackPanel IsItemsHost="True"
                                        KeyboardNavigation.DirectionalNavigation="Cycle"
                                        HorizontalAlignment="Stretch"
                                        VerticalAlignment="Stretch"/>
                        </Border>
                    </Border>
                </Popup>
            </Grid>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="Icon" Value="{x:Null}">
                <Setter TargetName="IconHost" Property="Visibility" Value="Collapsed"/>
            </Trigger>
            <Trigger Property="IsSubmenuOpen" Value="True">
                <Setter TargetName="ArrowGlyph" Property="Fill" Value="{StaticResource AccentBrush}"/>
            </Trigger>
            <Trigger Property="IsSuspendingPopupAnimation" Value="True">
                <Setter TargetName="PART_Popup" Property="PopupAnimation" Value="None"/>
            </Trigger>
            <Trigger SourceName="PART_Popup" Property="Tag" Value="False">
                <Setter TargetName="PART_Popup" Property="PopupAnimation" Value="None"/>
            </Trigger>
            <DataTrigger Binding="{Binding ElementName=PopupRoot, Path=Tag}" Value="True">
                <Setter TargetName="PopupRoot" Property="Effect">
                    <Setter.Value>
                        <DropShadowEffect Color="{Binding RelativeSource={RelativeSource AncestorType={x:Type MenuBase}}, Path=(params:General.ShadowBrush).(SolidColorBrush.Color)}"
                                          BlurRadius="4" ShadowDepth="2"
                                          Direction="315"
                                          Opacity="0.3"/>
                    </Setter.Value>
                </Setter>
                <Setter TargetName="PopupRoot" Property="Background" Value="{StaticResource TransparentBrush}"/>
                <Setter TargetName="PopupRoot" Property="Padding" Value="0,0,6,6"/>
            </DataTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <ControlTemplate x:Key="{x:Static MenuItem.SubmenuItemTemplateKey}" TargetType="{x:Type MenuItem}">
        <Border Background="{TemplateBinding Background}"
                BorderBrush="{TemplateBinding BorderBrush}"
                BorderThickness="{TemplateBinding BorderThickness}"
                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
            <Grid TextBlock.Foreground="{TemplateBinding Foreground}"
                  TextBlock.FontFamily="{TemplateBinding FontFamily}"
                  TextBlock.FontSize="{TemplateBinding FontSize}"
                  TextBlock.FontStretch="{TemplateBinding FontStretch}"
                  TextBlock.FontStyle="{TemplateBinding FontStyle}"
                  TextBlock.FontWeight="{TemplateBinding FontWeight}"
                  TextOptions.TextFormattingMode="{TemplateBinding TextOptions.TextFormattingMode}"
                  TextOptions.TextRenderingMode="{TemplateBinding TextOptions.TextRenderingMode}"
                  RenderOptions.ClearTypeHint="{TemplateBinding RenderOptions.ClearTypeHint}"
                  Margin="{TemplateBinding Padding}"
                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"
                                      SharedSizeGroup="ContextMenuIconSizeGroup"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"
                                      SharedSizeGroup="ContextMenuShortcutSizeGroup"/>
                </Grid.ColumnDefinitions>
                <Path x:Name="CheckBullet"
                      Grid.Column="0"
                      Stroke="{StaticResource HighlightBrush}"
                      StrokeThickness="{TemplateBinding params:General.BoldThicknessValue}"
                      Stretch="Uniform"
                      Visibility="Collapsed"
                      HorizontalAlignment="Center" VerticalAlignment="Center"
                      Width="{TemplateBinding params:MenuItem.BulletSize}" Height="{TemplateBinding params:MenuItem.BulletSize}">
                    <Path.Data>
                        <GeometryGroup>
                            <LineGeometry StartPoint="0,3" EndPoint="4,8"/>
                            <LineGeometry StartPoint="4,8" EndPoint="8,0"/>
                        </GeometryGroup>
                    </Path.Data>
                </Path>
                <ContentPresenter x:Name="IconHost"
                                  Grid.Column="0"
                                  ContentSource="Icon"
                                  HorizontalAlignment="Left"
                                  VerticalAlignment="Center"
                                  MinWidth="16" MinHeight="16"/>
                <ContentPresenter x:Name="HeaderHost"
                                  Grid.Column="1"
                                  ContentSource="Header"
                                  RecognizesAccessKey="True"
                                  Margin="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(params:General.BoldPaddingValue), Mode=OneWay, Converter={StaticResource DoubleToThicknessConverter}, ConverterParameter='Left, Right'}"
                                  HorizontalAlignment="Left"
                                  VerticalAlignment="Center"/>
                <TextBlock Grid.Column="2"
                           Text="{TemplateBinding InputGestureText}"
                           Margin="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(params:General.BoldPaddingValue), Mode=OneWay, Converter={StaticResource DoubleToThicknessConverter}, ConverterParameter='Left, Right'}"
                           HorizontalAlignment="Left"
                           VerticalAlignment="Center"/>
            </Grid>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="Icon" Value="{x:Null}">
                <Setter TargetName="IconHost" Property="Visibility" Value="Collapsed"/>
            </Trigger>
            <Trigger Property="IsCheckable" Value="True">
                <Setter TargetName="IconHost" Property="Visibility" Value="Collapsed"/>
            </Trigger>
            <Trigger Property="IsChecked" Value="True">
                <Setter TargetName="CheckBullet" Property="Visibility" Value="Visible"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style x:Key="{x:Type MenuItem}" TargetType="{x:Type MenuItem}">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Foreground" Value="{Binding Foreground, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}"/>
        <Setter Property="FontFamily" Value="{Binding FontFamily, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}"/>
        <Setter Property="FontSize" Value="{Binding FontSize, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}"/>
        <Setter Property="FontStretch" Value="{Binding FontStretch, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}"/>
        <Setter Property="FontStyle" Value="{Binding FontStyle, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}"/>
        <Setter Property="FontWeight" Value="{Binding FontWeight, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}"/>
        <Setter Property="TextOptions.TextFormattingMode" Value="{Binding (TextOptions.TextFormattingMode), Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}"/>
        <Setter Property="TextOptions.TextRenderingMode" Value="{Binding (TextOptions.TextRenderingMode), Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}"/>
        <Setter Property="RenderOptions.ClearTypeHint" Value="{Binding (RenderOptions.ClearTypeHint), Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}"/>
        <Setter Property="Focusable" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{StaticResource {x:Static SystemParameters.FocusVisualStyleKey}}"/>
        <!--<Setter.Value>
            <Style TargetType="{x:Type Control}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <Rectangle RenderOptions.EdgeMode="Aliased" Margin="{TemplateBinding params:General.DefaultPadding}" Stroke="Black" StrokeThickness="{TemplateBinding params:General.DefaultThicknessValue}" StrokeDashArray="2 1"/>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </Setter.Value>-->
        <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
        <Setter Property="ScrollViewer.PanningMode" Value="Both"/>
        <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}"/>
        <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}"/>
        <Setter Property="Padding" Value="{Binding Padding, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Style.Triggers>
            <Trigger Property="Role" Value="TopLevelHeader">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type MenuItem}">
                            <Border x:Name="LayoutRoot" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                                <Grid x:Name="ContentHost" RenderOptions.ClearTypeHint="{TemplateBinding RenderOptions.ClearTypeHint}" TextElement.Foreground="{TemplateBinding Foreground}" TextElement.FontWeight="{TemplateBinding FontWeight}" TextElement.FontStyle="{TemplateBinding FontStyle}" TextElement.FontStretch="{TemplateBinding FontStretch}" TextElement.FontSize="{TemplateBinding FontSize}" TextElement.FontFamily="{TemplateBinding FontFamily}" TextOptions.TextRenderingMode="{TemplateBinding TextOptions.TextRenderingMode}" TextOptions.TextFormattingMode="{TemplateBinding TextOptions.TextFormattingMode}">
                                    <ContentPresenter x:Name="HeaderHost" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" ContentStringFormat="{TemplateBinding HeaderStringFormat}" ContentSource="Header" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                    <Popup x:Name="PART_Popup" AllowsTransparency="True" 
                                           CustomPopupPlacementCallback="{x:Static params:DropDown.PopupPlacementCallback}" 
                                           Focusable="False" IsOpen="{Binding IsSubmenuOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Grid.IsSharedSizeScope="True" Placement="Custom">
                                        <Border x:Name="PopupRoot" SnapsToDevicePixels="True" Tag="{DynamicResource {x:Static SystemParameters.DropShadowKey}}">
                                            <Grid>
                                                <Border BorderBrush="{Binding (params:MenuBase.SubmenuBorderBrush), RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}" BorderThickness="{Binding (params:MenuBase.SubmenuBorderThickness), RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}" Background="{Binding (params:MenuBase.SubmenuBackground), RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}" RenderOptions.ClearTypeHint="{Binding (RenderOptions.ClearTypeHint), RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}" TextElement.Foreground="{Binding Foreground, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}" TextElement.FontWeight="{Binding FontWeight, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}" TextElement.FontStyle="{Binding FontStyle, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}" TextElement.FontStretch="{Binding FontStretch, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}" TextElement.FontSize="{Binding FontSize, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}" TextElement.FontFamily="{Binding FontFamily, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}" HorizontalAlignment="Stretch" TextOptions.TextRenderingMode="{Binding (TextOptions.TextRenderingMode), RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}" TextOptions.TextFormattingMode="{Binding (TextOptions.TextFormattingMode), RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}" VerticalAlignment="Stretch">
                                                    <StackPanel KeyboardNavigation.DirectionalNavigation="Cycle" IsItemsHost="True"/>
                                                </Border>
                                                <Rectangle x:Name="PopupMask" Fill="{Binding (params:MenuBase.SubmenuBackground), RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="{Binding ActualWidth, ElementName=ContentHost}">
                                                    <Rectangle.Margin>
                                                        <Binding Converter="{StaticResource ThicknessConverter}" ConverterParameter="Left" Path="(params:MenuBase.SubmenuBorderThickness)" RelativeSource="{RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}"/>
                                                    </Rectangle.Margin>
                                                </Rectangle>
                                            </Grid>
                                        </Border>
                                    </Popup>
                                </Grid>
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsSubmenuOpen" Value="True">
                                    <Setter Property="params:DropDown.IsOpen" TargetName="PART_Popup" Value="True"/>
                                </Trigger>
                                <Trigger Property="IsOpen" SourceName="PART_Popup" Value="True">
                                    <Setter Property="Background" TargetName="LayoutRoot" Value="{Binding (params:MenuBase.SubmenuBackground), RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}"/>
                                    <Setter Property="BorderBrush" TargetName="LayoutRoot" Value="{Binding (params:MenuBase.SubmenuBorderBrush), RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}"/>
                                </Trigger>
                                <MultiTrigger>
                                    <MultiTrigger.Conditions>
                                        <Condition Property="IsOpen" SourceName="PART_Popup" Value="True"/>
                                        <Condition Property="params:DropDown.IsDefaultHorizontalPosition" SourceName="PART_Popup" Value="True"/>
                                        <Condition Property="params:DropDown.IsDefaultVerticalPosition" SourceName="PART_Popup" Value="True"/>
                                    </MultiTrigger.Conditions>
                                    <Setter Property="BorderThickness" TargetName="LayoutRoot">
                                        <Setter.Value>
                                            <Binding Converter="{StaticResource ThicknessConverter}" ConverterParameter="Left, Top, Right" Path="(params:MenuBase.SubmenuBorderThickness)" RelativeSource="{RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}"/>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="Height" TargetName="PopupMask">
                                        <Setter.Value>
                                            <Binding Converter="{StaticResource ThicknessToDoubleConverter}" ConverterParameter="Top" Path="(params:MenuBase.SubmenuBorderThickness)" RelativeSource="{RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}"/>
                                        </Setter.Value>
                                    </Setter>
                                </MultiTrigger>
                                <MultiTrigger>
                                    <MultiTrigger.Conditions>
                                        <Condition Property="IsOpen" SourceName="PART_Popup" Value="True"/>
                                        <Condition Property="params:DropDown.IsDefaultHorizontalPosition" SourceName="PART_Popup" Value="True"/>
                                        <Condition Property="params:DropDown.IsDefaultVerticalPosition" SourceName="PART_Popup" Value="False"/>
                                    </MultiTrigger.Conditions>
                                    <Setter Property="BorderThickness" TargetName="LayoutRoot">
                                        <Setter.Value>
                                            <Binding Converter="{StaticResource ThicknessConverter}" ConverterParameter="Left, Right, Bottom" Path="(params:MenuBase.SubmenuBorderThickness)" RelativeSource="{RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}"/>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="Height" TargetName="PopupMask">
                                        <Setter.Value>
                                            <Binding Converter="{StaticResource ThicknessToDoubleConverter}" ConverterParameter="Bottom" Path="(params:MenuBase.SubmenuBorderThickness)" RelativeSource="{RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}"/>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="VerticalAlignment" TargetName="PopupMask" Value="Bottom"/>
                                </MultiTrigger>
                                <MultiDataTrigger>
                                    <MultiDataTrigger.Conditions>
                                        <Condition Binding="{Binding Tag, ElementName=PopupRoot}" Value="True"/>
                                        <Condition Binding="{Binding (params:DropDown.IsDefaultVerticalPosition), ElementName=PART_Popup}" Value="True"/>
                                    </MultiDataTrigger.Conditions>
                                    <Setter Property="Effect" TargetName="PopupRoot">
                                        <Setter.Value>
                                            <DropShadowEffect BlurRadius="4" Color="{Binding (params:General.ShadowBrush).(SolidColorBrush.Color), RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}" Direction="315" Opacity="0.3" ShadowDepth="2"/>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="Background" TargetName="PopupRoot" Value="Transparent"/>
                                    <Setter Property="Padding" TargetName="PopupRoot" Value="0,0,6,6"/>
                                </MultiDataTrigger>
                                <MultiDataTrigger>
                                    <MultiDataTrigger.Conditions>
                                        <Condition Binding="{Binding Tag, ElementName=PopupRoot}" Value="True"/>
                                        <Condition Binding="{Binding (params:DropDown.IsDefaultVerticalPosition), ElementName=PART_Popup}" Value="False"/>
                                    </MultiDataTrigger.Conditions>
                                    <Setter Property="Effect" TargetName="PopupRoot">
                                        <Setter.Value>
                                            <DropShadowEffect BlurRadius="4" Color="{Binding (params:General.ShadowBrush).(SolidColorBrush.Color), RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}" Direction="45" Opacity="0.3" ShadowDepth="0"/>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="Background" TargetName="PopupRoot" Value="Transparent"/>
                                    <Setter Property="Padding" TargetName="PopupRoot" Value="0,4,4,0"/>
                                </MultiDataTrigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="BorderThickness">
                    <Setter.Value>
                        <Binding Converter="{StaticResource ThicknessConverter}" ConverterParameter="Left, Top, Right" Path="(params:MenuBase.SubmenuBorderThickness)" RelativeSource="{RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}"/>
                    </Setter.Value>
                </Setter>
            </Trigger>
            <Trigger Property="Role" Value="TopLevelItem">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type MenuItem}">
                            <Border x:Name="LayoutRoot" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" RenderOptions.ClearTypeHint="{TemplateBinding RenderOptions.ClearTypeHint}" TextElement.Foreground="{TemplateBinding Foreground}" TextElement.FontWeight="{TemplateBinding FontWeight}" TextElement.FontStyle="{TemplateBinding FontStyle}" TextElement.FontStretch="{TemplateBinding FontStretch}" TextElement.FontSize="{TemplateBinding FontSize}" TextElement.FontFamily="{TemplateBinding FontFamily}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" TextOptions.TextRenderingMode="{TemplateBinding TextOptions.TextRenderingMode}" TextOptions.TextFormattingMode="{TemplateBinding TextOptions.TextFormattingMode}">
                                <ContentPresenter x:Name="HeaderHost" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" ContentStringFormat="{TemplateBinding HeaderStringFormat}" ContentSource="Header" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True"/>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="BorderThickness">
                    <Setter.Value>
                        <Binding Converter="{StaticResource ThicknessConverter}" ConverterParameter="Left, Top, Right" Path="(params:MenuBase.SubmenuBorderThickness)" RelativeSource="{RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}"/>
                    </Setter.Value>
                </Setter>
            </Trigger>
            <Trigger Property="Role" Value="SubmenuHeader">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type MenuItem}">
                            <Border x:Name="LayoutRoot" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                                <Grid RenderOptions.ClearTypeHint="{TemplateBinding RenderOptions.ClearTypeHint}" TextElement.Foreground="{TemplateBinding Foreground}" TextElement.FontWeight="{TemplateBinding FontWeight}" TextElement.FontStyle="{TemplateBinding FontStyle}" TextElement.FontStretch="{TemplateBinding FontStretch}" TextElement.FontSize="{TemplateBinding FontSize}" TextElement.FontFamily="{TemplateBinding FontFamily}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" TextOptions.TextRenderingMode="{TemplateBinding TextOptions.TextRenderingMode}" TextOptions.TextFormattingMode="{TemplateBinding TextOptions.TextFormattingMode}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition SharedSizeGroup="ContextMenuIconSizeGroup" Width="Auto"/>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <ContentPresenter x:Name="IconHost" Content="{TemplateBinding Icon}" Grid.Column="0" ContentSource="Icon" HorizontalAlignment="Left" MinWidth="16" MinHeight="16" VerticalAlignment="Center"/>
                                    <ContentPresenter x:Name="HeaderHost" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" Grid.Column="1" ContentStringFormat="{TemplateBinding HeaderStringFormat}" ContentSource="Header" HorizontalAlignment="Left" RecognizesAccessKey="True" VerticalAlignment="Center">
                                        <ContentPresenter.Margin>
                                            <Binding Converter="{StaticResource DoubleToThicknessConverter}" ConverterParameter="Left, Right" Mode="OneWay" Path="(params:General.BoldPaddingValue)" RelativeSource="{RelativeSource TemplatedParent}"/>
                                        </ContentPresenter.Margin>
                                    </ContentPresenter>
                                    <Polygon x:Name="ArrowGlyph" Grid.Column="2" Fill="#FF777777" HorizontalAlignment="Right" Height="{TemplateBinding params:MenuItem.ArrowSize}" Margin="{TemplateBinding params:MenuItem.ArrowMargin}" Points="0,0 2,2 0,4" Stretch="Uniform" StrokeThickness="0" VerticalAlignment="Center" Width="{TemplateBinding params:MenuItem.ArrowSize}"/>
                                    <Popup x:Name="PART_Popup" AllowsTransparency="True" Grid.Column="0" Focusable="False" IsOpen="{TemplateBinding IsSubmenuOpen}" Grid.IsSharedSizeScope="True" PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}" Placement="Right" Tag="{DynamicResource {x:Static SystemParameters.MenuAnimationKey}}">
                                        <Border x:Name="PopupRoot" Tag="{DynamicResource {x:Static SystemParameters.DropShadowKey}}">
                                            <Border BorderBrush="{Binding (params:MenuBase.SubmenuBorderBrush), RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}" BorderThickness="{Binding (params:MenuBase.SubmenuBorderThickness), RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}" Background="{Binding (params:MenuBase.SubmenuBackground), RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}" RenderOptions.ClearTypeHint="{Binding (RenderOptions.ClearTypeHint), RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}" TextElement.Foreground="{Binding Foreground, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}" TextElement.FontWeight="{Binding FontWeight, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}" TextElement.FontStyle="{Binding FontStyle, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}" TextElement.FontStretch="{Binding FontStretch, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}" TextElement.FontSize="{Binding FontSize, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}" TextElement.FontFamily="{Binding FontFamily, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}" SnapsToDevicePixels="{Binding SnapsToDevicePixels, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}" TextOptions.TextRenderingMode="{Binding (TextOptions.TextRenderingMode), RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}" TextOptions.TextFormattingMode="{Binding (TextOptions.TextFormattingMode), RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}">
                                                <StackPanel KeyboardNavigation.DirectionalNavigation="Cycle" HorizontalAlignment="Stretch" IsItemsHost="True" VerticalAlignment="Stretch"/>
                                            </Border>
                                        </Border>
                                    </Popup>
                                </Grid>
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="Icon" Value="{x:Null}">
                                    <Setter Property="Visibility" TargetName="IconHost" Value="Collapsed"/>
                                </Trigger>
                                <Trigger Property="IsSubmenuOpen" Value="True">
                                    <Setter Property="Fill" TargetName="ArrowGlyph" Value="#FF017BCD"/>
                                </Trigger>
                                <Trigger Property="IsSuspendingPopupAnimation" Value="True">
                                    <Setter Property="PopupAnimation" TargetName="PART_Popup" Value="None"/>
                                </Trigger>
                                <Trigger Property="Tag" SourceName="PART_Popup" Value="False">
                                    <Setter Property="PopupAnimation" TargetName="PART_Popup" Value="None"/>
                                </Trigger>
                                <DataTrigger Binding="{Binding Tag, ElementName=PopupRoot}" Value="True">
                                    <Setter Property="Effect" TargetName="PopupRoot">
                                        <Setter.Value>
                                            <DropShadowEffect BlurRadius="4" Color="{Binding (params:General.ShadowBrush).(SolidColorBrush.Color), RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type MenuBase}}}" Direction="315" Opacity="0.3" ShadowDepth="2"/>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="Background" TargetName="PopupRoot" Value="Transparent"/>
                                    <Setter Property="Padding" TargetName="PopupRoot" Value="0,0,6,6"/>
                                </DataTrigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
            <Trigger Property="Role" Value="SubmenuItem">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type MenuItem}">
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                                <Grid RenderOptions.ClearTypeHint="{TemplateBinding RenderOptions.ClearTypeHint}" TextElement.Foreground="{TemplateBinding Foreground}" TextElement.FontWeight="{TemplateBinding FontWeight}" TextElement.FontStyle="{TemplateBinding FontStyle}" TextElement.FontStretch="{TemplateBinding FontStretch}" TextElement.FontSize="{TemplateBinding FontSize}" TextElement.FontFamily="{TemplateBinding FontFamily}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" TextOptions.TextRenderingMode="{TemplateBinding TextOptions.TextRenderingMode}" TextOptions.TextFormattingMode="{TemplateBinding TextOptions.TextFormattingMode}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition SharedSizeGroup="ContextMenuIconSizeGroup" Width="Auto"/>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition SharedSizeGroup="ContextMenuShortcutSizeGroup" Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <Path x:Name="CheckBullet" Grid.Column="0" HorizontalAlignment="Center" Height="{TemplateBinding params:MenuItem.BulletSize}" Stretch="Uniform" Stroke="#FF4D4D4D" StrokeThickness="{TemplateBinding params:General.BoldThicknessValue}" Visibility="Collapsed" VerticalAlignment="Center" Width="{TemplateBinding params:MenuItem.BulletSize}">
                                        <Path.Data>
                                            <GeometryGroup>
                                                <LineGeometry EndPoint="4,8" StartPoint="0,3"/>
                                                <LineGeometry EndPoint="8,0" StartPoint="4,8"/>
                                            </GeometryGroup>
                                        </Path.Data>
                                    </Path>
                                    <ContentPresenter x:Name="IconHost" Content="{TemplateBinding Icon}" Grid.Column="0" ContentSource="Icon" HorizontalAlignment="Left" MinWidth="16" MinHeight="16" VerticalAlignment="Center"/>
                                    <ContentPresenter x:Name="HeaderHost" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" Grid.Column="1" ContentStringFormat="{TemplateBinding HeaderStringFormat}" ContentSource="Header" HorizontalAlignment="Left" RecognizesAccessKey="True" VerticalAlignment="Center">
                                        <ContentPresenter.Margin>
                                            <Binding Converter="{StaticResource DoubleToThicknessConverter}" ConverterParameter="Left, Right" Mode="OneWay" Path="(params:General.BoldPaddingValue)" RelativeSource="{RelativeSource TemplatedParent}"/>
                                        </ContentPresenter.Margin>
                                    </ContentPresenter>
                                    <TextBlock Grid.Column="2" HorizontalAlignment="Left" Text="{TemplateBinding InputGestureText}" VerticalAlignment="Center">
                                        <TextBlock.Margin>
                                            <Binding Converter="{StaticResource DoubleToThicknessConverter}" ConverterParameter="Left, Right" Mode="OneWay" Path="(params:General.BoldPaddingValue)" RelativeSource="{RelativeSource TemplatedParent}"/>
                                        </TextBlock.Margin>
                                    </TextBlock>
                                </Grid>
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="Icon" Value="{x:Null}">
                                    <Setter Property="Visibility" TargetName="IconHost" Value="Collapsed"/>
                                </Trigger>
                                <Trigger Property="IsCheckable" Value="True">
                                    <Setter Property="Visibility" TargetName="IconHost" Value="Collapsed"/>
                                </Trigger>
                                <Trigger Property="IsChecked" Value="True">
                                    <Setter Property="Visibility" TargetName="CheckBullet" Value="Visible"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
            <Trigger Property="IsHighlighted" Value="True">
                <Setter Property="Background" Value="#FFDEDEDE"/>
                <Setter Property="Foreground" Value="Black"/>
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="Role" Value="TopLevelHeader"/>
                    <Condition Property="IsHighlighted" Value="True"/>
                </MultiTrigger.Conditions>
                <Setter Property="Background" Value="#FFDEDEDE"/>
                <Setter Property="BorderBrush" Value="#FFDEDEDE"/>
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="Role" Value="TopLevelItem"/>
                    <Condition Property="IsHighlighted" Value="True"/>
                </MultiTrigger.Conditions>
                <Setter Property="Background" Value="#FFDEDEDE"/>
                <Setter Property="BorderBrush" Value="#FFDEDEDE"/>
            </MultiTrigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Foreground" Value="#FFB8B5B2"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    
    
    
    
    
    <controls:Icon x:Key="NextMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource NextIconStyle}"/>
    <Style x:Key="NextMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Next"/>
        <Setter Property="Icon" Value="{StaticResource NextMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="PreviousMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource PreviousIconStyle}"/>
    <Style x:Key="PreviousMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Previous"/>
        <Setter Property="Icon" Value="{StaticResource PreviousMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="UpMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource RoadForwardIconStyle}"/>
    <Style x:Key="UpMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Up"/>
        <Setter Property="Icon" Value="{StaticResource UpMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="DownMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource RoadBackwardIconStyle}"/>
    <Style x:Key="DownMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Down"/>
        <Setter Property="Icon" Value="{StaticResource DownMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="TopMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource TopIconStyle}"/>
    <Style x:Key="TopMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Top"/>
        <Setter Property="Icon" Value="{StaticResource TopMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="BottomMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource BottomIconStyle}"/>
    <Style x:Key="BottomMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Bottom"/>
        <Setter Property="Icon" Value="{StaticResource BottomMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="CutMenuItemIcon" 
                    x:Shared="False"  
                    Style="{StaticResource CutIconStyle}"/>
    <Style x:Key="CutMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Cut"/>
        <Setter Property="Icon" Value="{StaticResource CutMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="CopyMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource CopyIconStyle}"/>
    <Style x:Key="CopyMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Copy"/>
        <Setter Property="Icon" Value="{StaticResource CopyMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="PasteMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource Paste1IconStyle}"/>
    <Style x:Key="PasteMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Paste"/>
        <Setter Property="Icon" Value="{StaticResource PasteMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="AddMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource Add1IconStyle}"/>
    <Style x:Key="AddMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Add"/>
        <Setter Property="Icon" Value="{StaticResource AddMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="RemoveMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource SubtractIconStyle}"/>
    <Style x:Key="RemoveMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Remove"/>
        <Setter Property="Icon" Value="{StaticResource RemoveMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="DeleteMenuItemIcon" 
                    x:Shared="False"  
                    Style="{StaticResource Delete1IconStyle}"/>
    <Style x:Key="DeleteMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Delete"/>
        <Setter Property="Icon" Value="{StaticResource DeleteMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="TrashMenuItemIcon" 
                    x:Shared="False"  
                    Style="{StaticResource TrashIconStyle}"/>
    <Style x:Key="TrashMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Trash"/>
        <Setter Property="Icon" Value="{StaticResource TrashMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="OkMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource OkIconStyle}"/>
    <Style x:Key="OkMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Ok"/>
        <Setter Property="Icon" Value="{StaticResource OkMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="CancelMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource Cancel1IconStyle}"/>
    <Style x:Key="CancelMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Cancel"/>
        <Setter Property="Icon" Value="{StaticResource CancelMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="NewMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource New1IconStyle}"/>
    <Style x:Key="NewMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="New"/>
        <Setter Property="Icon" Value="{StaticResource NewMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="PrintMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource PrintIconStyle}"/>
    <Style x:Key="PrintMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Print"/>
        <Setter Property="Icon" Value="{StaticResource PrintMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="PrintPreviewMenuItemIcon" 
                    x:Shared="False"  
                    Style="{StaticResource PreviewIconStyle}"/>
    <Style x:Key="PrintPreviewMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Print Preview"/>
        <Setter Property="Icon" Value="{StaticResource PrintPreviewMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="ExportMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource Export1IconStyle}"/>
    <Style x:Key="ExportMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Export"/>
        <Setter Property="Icon" Value="{StaticResource ExportMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="ExportCsvMenuItemIcon" 
                    x:Shared="False"  
                    Style="{StaticResource CSVExportIconStyle}"/>
    <Style x:Key="ExportCsvMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Export CSV"/>
        <Setter Property="Icon" Value="{StaticResource ExportCsvMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="ExcelMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource MicrosoftExcel1IconStyle}"/>
    <Style x:Key="ExcelMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Excel"/>
        <Setter Property="Icon" Value="{StaticResource ExcelMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="WordMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource MicrosoftWord1IconStyle}"/>
    <Style x:Key="WordMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Word"/>
        <Setter Property="Icon" Value="{StaticResource WordMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="OutlookMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource MicrosoftOutlookIconStyle}"/>
    <Style x:Key="OutlookMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Outlook"/>
        <Setter Property="Icon" Value="{StaticResource OutlookMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="PowerPointMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource MicrosoftPowerPointIconStyle}"/>
    <Style x:Key="PowerPointMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="PowerPoint"/>
        <Setter Property="Icon" Value="{StaticResource PowerPointMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="AdobeMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource AdobeIconStyle}"/>
    <Style x:Key="PdfMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="PDF"/>
        <Setter Property="Icon" Value="{StaticResource AdobeMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="ExpandCollapseMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource ExpandCollapseIconStyle}"/>
    <Style x:Key="ExpandCollapseMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Expand/Collapse"/>
        <Setter Property="Icon" Value="{StaticResource ExpandCollapseMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="ExpandMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource ExpandIconStyle}"/>
    <Style x:Key="ExpandMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Expand"/>
        <Setter Property="Icon" Value="{StaticResource ExpandMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="CollapseMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource CollapseIconStyle}"/>
    <Style x:Key="CollapseMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Collapse"/>
        <Setter Property="Icon" Value="{StaticResource CollapseMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="RefreshMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource Refresh1IconStyle}"/>
    <Style x:Key="RefreshMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Refresh"/>
        <Setter Property="Icon" Value="{StaticResource RefreshMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="UndoMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource Undo1IconStyle}"/>
    <Style x:Key="UndoMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Undo"/>
        <Setter Property="Icon" Value="{StaticResource UndoMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="RedoMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource Redo1IconStyle}"/>
    <Style x:Key="RedoMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Redo"/>
        <Setter Property="Icon" Value="{StaticResource RedoMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="SaveMenuItemIcon" 
                    x:Shared="False"  
                    Style="{StaticResource Save1IconStyle}"/>
    <Style x:Key="SaveMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Save"/>
        <Setter Property="Icon" Value="{StaticResource SaveMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="SaveAsMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource SaveAsIconStyle}"/>
    <Style x:Key="SaveAsMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Save As"/>
        <Setter Property="Icon" Value="{StaticResource SaveAsMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="SaveAllMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource SaveAllAttachmentsIconStyle}"/>
    <Style x:Key="SaveAllMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Save All"/>
        <Setter Property="Icon" Value="{StaticResource SaveAllMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="HomeMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource HouseIconStyle}"/>
    <Style x:Key="HomeMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Home"/>
        <Setter Property="Icon" Value="{StaticResource HomeMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="EditMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource Edit2IconStyle}"/>
    <Style x:Key="EditMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Edit"/>
        <Setter Property="Icon" Value="{StaticResource EditMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="HelpMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource Help1IconStyle}"/>
    <Style x:Key="HelpMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Help"/>
        <Setter Property="Icon" Value="{StaticResource HelpMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="OpenMenuItemIcon" 
                    x:Shared="False"  
                    Style="{StaticResource Open1IconStyle}"/>
    <Style x:Key="OpenMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Open"/>
        <Setter Property="Icon" Value="{StaticResource OpenMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="CloseMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource Close1IconStyle}"/>
    <Style x:Key="CloseMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Close"/>
        <Setter Property="Icon" Value="{StaticResource CloseMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="ReloadMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource ReloadIconStyle}"/>
    <Style x:Key="ReloadMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Reload"/>
        <Setter Property="Icon" Value="{StaticResource ReloadMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="SearchMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource SearchIconStyle}"/>
    <Style x:Key="SearchMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Search"/>
        <Setter Property="Icon" Value="{StaticResource SearchMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="SettingsMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource Settings1IconStyle}"/>
    <Style x:Key="SettingsMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Settings"/>
        <Setter Property="Icon" Value="{StaticResource SettingsMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="ZoomMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource ZoomIconStyle}"/>
    <Style x:Key="ZoomMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Zoom"/>
        <Setter Property="Icon" Value="{StaticResource ZoomMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="ZoomInMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource ZoomInIconStyle}"/>
    <Style x:Key="ZoomInMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Zoom In"/>
        <Setter Property="Icon" Value="{StaticResource ZoomInMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="ZoomOutMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource ZoomOutIconStyle}"/>
    <Style x:Key="ZoomOutMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Zoom Out"/>
        <Setter Property="Icon" Value="{StaticResource ZoomOutMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="DecimalPlacesMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource DecimalPlacesIconStyle}"/>
    <Style x:Key="DecimalPlacesMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Decimal Places"/>
        <Setter Property="Icon" Value="{StaticResource DecimalPlacesMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="DisplayMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource Monitor1IconStyle}"/>
    <Style x:Key="DisplayMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Display"/>
        <Setter Property="Icon" Value="{StaticResource DisplayMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="ViewMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource ViewIconStyle}"/>
    <Style x:Key="ViewMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="View"/>
        <Setter Property="Icon" Value="{StaticResource ViewMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="PublishMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource BookAddIconStyle}"/>
    <Style x:Key="PublishMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Publish"/>
        <Setter Property="Icon" Value="{StaticResource PublishMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="UnpublishMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource BookDeleteIconStyle}"/>
    <Style x:Key="UnpublishMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Un-Publish"/>
        <Setter Property="Icon" Value="{StaticResource UnpublishMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="RenameMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource RenameIconStyle}"/>
    <Style x:Key="RenameMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Rename"/>
        <Setter Property="Icon" Value="{StaticResource RenameMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="FolderNewMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource FolderNewIconStyle}"/>
    <Style x:Key="FolderNewMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="New Folder"/>
        <Setter Property="Icon" Value="{StaticResource FolderNewMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="FolderOpenMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource FolderOpenIconStyle}"/>
    <Style x:Key="FolderOpenMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Open Folder"/>
        <Setter Property="Icon" Value="{StaticResource FolderOpenMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="ColumnChooserMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource ColumnChooserIconStyle}"/>
    <Style x:Key="ColumnChooserMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Choose Columns"/>
        <Setter Property="Icon" Value="{StaticResource ColumnChooserMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="ShowAmountMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource AmountIconStyle}"/>
    <Style x:Key="ShowAmountMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Show Amounts"/>
        <Setter Property="Icon" Value="{StaticResource ShowAmountMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="ShowPercentageMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource PercentageIconStyle}"/>
    <Style x:Key="ShowPercentageMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Show Percentages"/>
        <Setter Property="Icon" Value="{StaticResource ShowPercentageMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="AlignMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource TextJustifyAlignIconStyle}"/>
    <Style x:Key="AlignMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Align"/>
        <Setter Property="Icon" Value="{StaticResource AlignMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="TextRightAlignMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource TextRightAlignIconStyle}"/>
    <Style x:Key="TextRightAlignMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Right Align"/>
        <Setter Property="Icon" Value="{StaticResource TextRightAlignMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="TextLeftAlignMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource TextLeftAlignIconStyle}"/>
    <Style x:Key="TextLeftAlignMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Left Align"/>
        <Setter Property="Icon" Value="{StaticResource TextLeftAlignMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="TextCenterAlignMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource TextCenterAlignIconStyle}"/>
    <Style x:Key="TextCenterAlignMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Center"/>
        <Setter Property="Icon" Value="{StaticResource TextCenterAlignMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="TextJustifyAlignMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource TextJustifyAlignIconStyle}"/>
    <Style x:Key="TextJustifyAlignMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Justify"/>
        <Setter Property="Icon" Value="{StaticResource TextJustifyAlignMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="HorizontalMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource HorizontalIconStyle}"/>
    <controls:Icon x:Key="VerticalMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource VerticalIconStyle}"/>
    <Style x:Key="HorizontalVerticalMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Horizontal"/>
        <Setter Property="Icon" Value="{StaticResource HorizontalMenuItemIcon}"/>
        <Setter Property="IsCheckable" Value="True"/>
        <Style.Triggers>
            <Trigger Property="IsChecked" Value="True">
                <Setter Property="Header" Value="Vertical"/>
                <Setter Property="Icon" Value="{StaticResource VerticalMenuItemIcon}"/>
            </Trigger>
        </Style.Triggers>
    </Style>
    <controls:Icon x:Key="FontSizeMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource FontSizeIconStyle}"/>
    <Style x:Key="FontSizeMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Font Size"/>
        <Setter Property="Icon" Value="{StaticResource FontSizeMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="ListMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource ListIconStyle}"/>
    <Style x:Key="ListMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="List"/>
        <Setter Property="Icon" Value="{StaticResource ListMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="BulletMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource BulletIconStyle}"/>
    <Style x:Key="BulletMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Bullets"/>
        <Setter Property="Icon" Value="{StaticResource BulletMenuItemIcon}"/>
    </Style>
    <controls:Icon x:Key="NumberingMenuItemIcon" 
                    x:Shared="False" 
                    Style="{StaticResource NumberingIconStyle}"/>
    <Style x:Key="NumberingMenuItemStyle" BasedOn="{StaticResource {x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Setter Property="Header" Value="Numbering"/>
        <Setter Property="Icon" Value="{StaticResource NumberingMenuItemIcon}"/>
    </Style>

    <!-- MenuItem Slider -->
    <Style x:Key="DecimalPlacesSliderMenuItemStyle" BasedOn="{StaticResource DecimalPlacesMenuItemStyle}" TargetType="{x:Type MenuItem}">
        <Setter Property="HeaderTemplate">
            <Setter.Value>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <Slider IsSnapToTickEnabled="True"
                                Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                                Maximum="5"
                                Minimum="0"
                                TickFrequency="1"
                                Value="{Binding ElementName=IntegerUpDown, Path=Value}"
                                Width="250"/>
                        <controls:IntegerUpDown x:Name="IntegerUpDown" 
                                                AllowSpin="True" 
                                                BorderThickness="0" 
                                                Background="{StaticResource TransparentBrush}"
                                                FormatString="0 Decimal Places"  
                                                Increment="1"
                                                Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                                                Maximum="5"
                                                Minimum="0"
                                                Padding="{Binding Converter={StaticResource DoubleToThicknessConverter}, ConverterParameter='Right', RelativeSource={RelativeSource Self}, Path=(params:General.BoldPaddingValue), Mode=OneWay}"
                                                ShowButtonSpinner="True"
                                                Value="{Binding Path=Header, RelativeSource={RelativeSource AncestorType={x:Type MenuItem}}}"/>
                    </StackPanel>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ZoomSliderMenuItemStyle" BasedOn="{StaticResource ZoomMenuItemStyle}" TargetType="{x:Type MenuItem}">
        <Setter Property="HeaderTemplate">
            <Setter.Value>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <Slider IsSnapToTickEnabled="True"
                                Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                                Maximum="3"
                                Minimum="0.5"
                                TickFrequency="0.1"
                                Value="{Binding Path=Header, RelativeSource={RelativeSource AncestorType={x:Type MenuItem}}}"
                                Width="250"/>
                        <controls:DoubleUpDown AllowSpin="True"
                                               BorderThickness="0" 
                                               Background="{StaticResource TransparentBrush}"
                                               FormatString="x 0.0"  
                                               Increment="0.1"
                                               Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                                               Maximum="3"
                                               Minimum="0.5"
                                               Padding="{Binding Converter={StaticResource DoubleToThicknessConverter}, ConverterParameter='Right', RelativeSource={RelativeSource Self}, Path=(params:General.BoldPaddingValue), Mode=OneWay}"
                                               ShowButtonSpinner="True"
                                               Value="{Binding Path=Header, RelativeSource={RelativeSource AncestorType={x:Type MenuItem}}}"/>
                    </StackPanel>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="FontSizeSliderMenuItemStyle" BasedOn="{StaticResource FontSizeMenuItemStyle}" TargetType="{x:Type MenuItem}">
        <Setter Property="HeaderTemplate">
            <Setter.Value>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <Slider IsSnapToTickEnabled="True"
                                Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                                Maximum="72"
                                Minimum="8"
                                TickFrequency="1"
                                Value="{Binding Path=Header, RelativeSource={RelativeSource AncestorType={x:Type MenuItem}}}"
                                Width="250"/>
                        <controls:DoubleUpDown AllowSpin="True"
                                               BorderThickness="0" 
                                               Background="{StaticResource TransparentBrush}"  
                                               Increment="1"
                                               Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                                               Maximum="72"
                                               Minimum="8"
                                               Padding="{Binding Converter={StaticResource DoubleToThicknessConverter}, ConverterParameter='Right', RelativeSource={RelativeSource Self}, Path=(params:General.BoldPaddingValue), Mode=OneWay}"
                                               ShowButtonSpinner="True"
                                               Value="{Binding Path=Header, RelativeSource={RelativeSource AncestorType={x:Type MenuItem}}}"/>
                    </StackPanel>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>